package lumis.portal.propertybag.serialization;

import lumis.portal.PortalException;
import lumis.portal.propertybag.PropertyBag;
import lumis.portal.serialization.BaseSerializationContext;
import lumis.portal.serialization.DeserializationContext;
import lumis.portal.serialization.SerializationContext;

/**
 * Manager interface for property bag serialization
 *
 * @version $Revision: 10825 $ $Date: 2009-08-04 12:36:40 -0300 (Tue, 04 Aug 2009) $
 * @since 5.0.0
 */
public interface IPropertyBagSerializationManager
{
	// DESERIALIZATION
	
	/**
	 * Deserializes a {@link PropertyBag} object.
	 * @param deserializationContext the deserialization context.
	 * @param propertyBagId the property bag identifier.
	 * @param parentPropertyBagId the identifier of the parent of the property bag.
	 */
	public void deserializePropertyBag(DeserializationContext deserializationContext, String propertyBagId, String parentPropertyBagId) throws PortalException;

	// SERIALIZATION
	
	/**
	 * Serializes a property bag.
	 * @param serializationContext the serialization context.
	 * @param propertyBag the property bag.
	 */
	public void serialize(SerializationContext serializationContext, String propertyBag) throws PortalException;

	// GENERAL
	
	/**
	 * Set up a serialization context, defining settings such as class aliases, field aliases, transient fields, omitted collections etc.
	 * @param serializationContext
	 */
	public void setupSerializationContext(BaseSerializationContext serializationContext);
}
